package com.wenda.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wenda.bean.ResultBean;
import com.wenda.entity.Specialty;
import com.wenda.entity.User;
import com.wenda.service.SpecialtyService;

@Controller
public class SpecialtyController {
	@Autowired
	SpecialtyService specialtyService;
	@ResponseBody
	@RequestMapping("/specialtys")
	public ResultBean findByCollege(HttpServletRequest request) {
		User user = (User) request.getSession().getAttribute("user");
		List<Specialty> list = specialtyService.findByCollege(user.getCollegeId());
		return ResultBean.build(200, "加载成功",list);
	}
}
